<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>进度条</title>
	<link rel="stylesheet" href="../css/bootstrap.css">
</head>
<body>
	<div class="progress danger">
		<div class="progress-bar progress-bar-success egm" style="min-height: 1em;width: 0;">0%</div>
	</div>
	<script src="../js/jquery-3.4.1.js" type="text/javascript"></script>
	<script src="../js/bootstrap.js" type="text/javascript"></script>
	<script type="text/javascript">
		let width = 0
		$(function() {
			let id = setInterval(function() {
				width++
				if (width <= 100) {
					$('.egm').attr('style',`min-width: 1em; width: ${width}%;`).text(`${width}%`)
				} else {
					clearInterval(id)
					alert("加载成功")
				}
			},400)
		})
	</script>
</body>
</html>